﻿using PushManager.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.Owin;
using Owin;
using Hangfire;
using Hangfire.Dashboard;
using System.Collections.Generic;

[assembly: OwinStartup(typeof(Startup))]

namespace PushManager.Web
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            //hangfire在服務器端的權限問題,以及速度問題,兩大問題,難以解決
            //GlobalConfiguration.Configuration.UseSqlServerStorage("hangfire");
            //app.UseHangfireDashboard("/hf", new DashboardOptions { AppPath = "/", AuthorizationFilters = new List<IAuthorizationFilter> { new CusHfAuthorizationFilter() } });
            //app.UseHangfireServer();


            GlobalHost.HubPipeline.AddModule(new ErrorhandlingModule());
            app.MapSignalR("/push", new HubConfiguration
            {
                EnableDetailedErrors = true,
                EnableJSONP = true,
            });
        }
    }
}